<template>
  <div class="">
         <ul class="catagtory">
        <li :class='{select:currentId===item.id}' @click="liClick(item.id)"  v-for="item in typeList" :key="item.id">{{item.name}}</li> 
      </ul>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: '',
  computed:{
    ...mapState('type',['typeList','currentId'])
  },
  methods: {
      liClick(id){
      this.$store.commit('type/setCurrentId',id)
      this.$store.dispatch('list/getInfoList',id)
    }
  },
    created(){
     this.$store.dispatch('type/getTypeList')
  },
}
</script>

<style scoped>

</style>
